import { Component,Input,Output,EventEmitter } from '@angular/core';

@Component({
  selector: 'app-checkbox',
  templateUrl: './checkbox.component.html',
  styleUrls: ['./checkbox.component.css']
})
export class CheckboxComponent {
  
  @Input()checked:Boolean;
  @Input()disabled:Boolean;
  @Output() toggle=new EventEmitter<Boolean>();

  constructor() { }

  ngOnInit() {
     this.disabled=this.disabled ? true : false;
     this.checked=this.checked ? true : false;
  }

  ngAfterContentInit(){
      
  }

  doCheck(e){
    this.toggle.emit(e.target.checked);
  }

}
